package com.qianchang.microfinance.bean;

/**
 * 版 权: 深圳市迪蒙网络科技有限公司
 * 描 述: <服务器返回的最外层数据>
 * 修 改 人: sushuo
 * 修改时间: 2017-4-14
 */

public class ResultBean<T> {


    private T      data;
    private String description;
    private String code;


    public static final String RESULT_SUCCESS     = "000000";
    public static final String RESULT_TOKEN_ERROR = "200001";


    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public boolean isOk() {
        return RESULT_SUCCESS.equals(code);
    }

    /**
     * 请求数据OK
     *
     * @return
     */
    public boolean isSuccess() {
        return RESULT_SUCCESS.equals(code) && data != null;
    }


}
